<template>
  <div class="order-page">
    <headBar  isBack="show">
      <div slot="xm-header-center">
        <div class="xm-header-title" >订单支付</div>
      </div>
      <div slot="xm-header-right"></div>
    </headBar>
    <div class="order-head flex flex-pack-justify flex-pack-center">
      <div>
        <p class="p1">订单号：{{form.code}}</p>
        <p class="p2">实际付款金额:<b class="color-money">￥</b><span class="price">{{money | money}}元</span></p>
      </div>
    </div>
    <div class="select-tit">选择支付方式</div>
    <div class="select-pay">
      <a href="javascript:;" class="item flex flex-pack-justify border-bottom" @click="pay(1)">
        <span class="logo wechat">微信支付</span><i class="icon icon-arrowright"></i></a>
      <!--<a href="javascript:;" class="item flex flex-pack-justify border-bottom" @click="pay(2)">-->
        <!--<span class="logo zhifubao">支付宝支付</span><i class="icon icon-arrowright"></i></a>-->
      <a href="javascript:;" class="item flex flex-pack-justify border-bottom" @click="pay(3)">
        <span class="logo yinglian">银联支付</span><i class="icon icon-arrowright"></i></a>
    </div>
    <form action="/panda-app/order/orderPay" method="post" class="hide" ref="form">
      <input type="text" name="code" v-model="form.code">
      <input type="text" name="payMethodId" v-model="form.payMethodId" ref="payMethodId">
    </form>
  </div>
</template>
<script>

  export default {
    props: {},
    data() {
      return {
        money: this.$route.params.money,
        form: {
          code: this.$route.params.orderCode,
          payMethodId: 1
        }
      };
    },
    methods: {
      /**
       * 支付
       * @param <number> 支付方式
       * */
      pay(type){
        this.$refs.payMethodId.value = type;
        this.$refs.form.submit();
//        orderPay(this.form).then(data=>{
//            if(data.returnCode == '000000'){
//              console.log('支付成功！');
//            }
//        })
      }
    },
    filters: {},
    created() {
    },
    mounted(){

    },
    components: {
    }
  };
</script>
<style lang="less">
  @import "./order.less";
</style>
<style>
  .order-page .select-tit{
    font-size: .26rem;
  }
</style>
